package com.fortune.rainshineservice.mapper;

import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.fortune.rainshinecommon.entity.CustomerEntity;
import com.fortune.rainshinecommon.model.CustomerModel;
import com.fortune.rainshinecommon.model.DayShopStatModel;
import com.fortune.rainshinecommon.query.CustomerQuery;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

@Mapper
public interface CustomerMapper extends BaseMapper<CustomerModel> {
    int selectCountByPhone(String customerPhone);

    int save(CustomerModel customerModel);

    List<CustomerEntity> getList(CustomerQuery query);

    CustomerModel selectByCustomerCode(String customerCode);

    int update(CustomerModel customerModel);

    /**
     * 根据门店id获取此门店的会员数量
     * @param shopId
     * @return
     */
    int selectCountByShopId(Integer shopId);

    String getNameByCode(String customerCode);

    List<DayShopStatModel> getNewCustomerNum(String date);
}
